import { Get, Post, PostJson }  from './request';
/** 区域管理 */

export interface IArea {
    id?: number,
    createId?: string,
    createTime?: string,
    name: string,
    status?: string,
    orderNum?: number,
    parentId?: number,
}
/** 获取全部区域信息 */
export const getAllArea = (): Promise<IArea[]> => Get('/area/all')

/** 区域具体信息
 * id
 */
export const getAreaInfoById = (id: unknown) => Get(`/area/info/${id}`)

/** 区域列表 */
export const getAreaList = () => Get(`/area/list`)

/** 新增区域 */
export const saveArea = (data: IArea) => PostJson('/area/save', data)

/** 更新区域信息 */
export const updateArea = (data: IArea) => PostJson('/area/update', data)

/** 删除区域 */
export const deleteAreaApi = (data: Array<number>) => PostJson('/area/delete', data)

